# Contributor: Jacek Pruciak <alpine@juniorjpdj.pl>
# Maintainer: Jacek Pruciak <alpine@juniorjpdj.pl>
pkgname=py3-dirty-equals
pkgver=0.7.1
pkgrel=1
pkgdesc="Doing dirty (but extremely useful) things with equals."
url="https://github.com/samuelcolvin/dirty-equals"
license="MIT"
arch="noarch"
depends="py3-tz"
makedepends="py3-gpep517 py3-installer py3-wheel py3-hatchling"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/samuelcolvin/dirty-equals/archive/v$pkgver/dirty-equals-$pkgver.tar.gz"
builddir="$srcdir/dirty-equals-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	# needs pytest-examples but that requires ruff that limits it a bunch
	local ignore="--ignore=tests/test_docs.py"

	# needs pydantic, which introduces circular dep
	ignore="$ignore --ignore=tests/test_other.py"

	# https://github.com/samuelcolvin/dirty-equals/issues/97
	local k="not test_is_datetime[unix-int] and not test_is_datetime[unix-float]"

	pytest $ignore -k "$k"
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
c50a15e4cee77b3db1b07ef9f7d1eb5b3ab6bed6d914ac5c9e2982f8cf9432beaecb5fd7997d46a94f405e0c932ea5a8d72f1c1d4b6dda86161c22cc772ab4d7  dirty-equals-0.7.1.tar.gz
"
